package com.example.demospringboot.flow.converter;

import com.fasterxml.jackson.databind.JsonNode;
import org.flowable.bpmn.model.BpmnModel;
import org.flowable.editor.language.json.converter.BpmnJsonConverter;

/**
 * @author zhaoPin
 * @Date 2024/8/23  14:45
 * @description:
 */
public class CustomBpmnJsonConverter extends BpmnJsonConverter {

    @Override
    public BpmnModel convertToBpmnModel(JsonNode modelNode) {
        // 使用自定义解析类 解析用户节点自定义参数 ，覆盖系统默认
        convertersToBpmnMap.put("UserTask", LocalUserTaskJsonConverter.class);

        BpmnModel bpmnModel = super.convertToBpmnModel(modelNode);

        // 处理自定义属性

        return bpmnModel;
    }

}
